package com.uptown.matrix.core.template;

import java.util.List;

import com.uptown.matrix.core.annotation.MatrixMessageListener;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus;
import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently;
import org.apache.rocketmq.common.message.MessageExt;
import org.springframework.stereotype.Component;

@Component
public class RocketMqConsumer {


    @MatrixMessageListener(
            streamKey = "uptown",
            consumerGroup = "uptown_group",
            componentType = "rocketmq",
            bootServer = "192.168.1.167:9876"
    )
    public void consumeMessage(List<MessageExt> msg) {
        for (MessageExt m : msg) {
            System.out.println("监听到数据 -> " + new String(m.getBody()));
        }
    }
}
